from django.conf               import settings
from django.conf.urls.defaults import *
from sitepal.sitemenu.views    import serve_content
from sitepal.sitetheme.views   import theme_front_page,theme_media

urlpatterns = patterns('',
    url(r'^cms/(?P<path>.*)$',serve_content,name='sitepal_menu_view'),
    url(r'^media/themes/(?P<theme>[-\w]+)/(?P<name>.+)$',theme_media,name='theme_media'),
    url(r'^$',theme_front_page,name='theme_front_page'),
)

if settings.DEBUG:
    from django.views.static import serve as serve_static
    
    urlpatterns += patterns('',
        url(r'^media/(?P<path>.*)$',serve_static,kwargs={'document_root':settings.MEDIA_ROOT}),
    )
